CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

SET( MTM_PATH
	"${CMAKE_SOURCE_DIR}/../.." )

SET( PRJ_PATH
	"${CMAKE_SOURCE_DIR}" )

SET( EXECUTABLE_OUTPUT_PATH
	"${PRJ_PATH}/exe/${CMAKE_BUILD_TYPE}" )

SET( PRJ_NAME	  "example-1" )
SET( EXE_NAME   "${PRJ_NAME}" )
SET( LIB_PATH   "${MTM_PATH}/lib/${CMAKE_BUILD_TYPE}" )
SET( INC_PATH   "${MTM_PATH}/inc" )
SET( SRC_PATH   "${PRJ_PATH}" )
SET( EXE_PATH 	"${EXECUTABLE_OUTPUT_PATH}" )

MESSAGE( STATUS "MTM_PATH:    " ${MTM_PATH} )
MESSAGE( STATUS "PRJ_PATH:    " ${PRJ_PATH} )
MESSAGE( STATUS "PRJ_NAME:    " ${PRJ_NAME} )
MESSAGE( STATUS "EXE_NAME:    " ${EXE_NAME} )
MESSAGE( STATUS "LIB_PATH:    " ${LIB_PATH} )
MESSAGE( STATUS "INC_PATH:    " ${INC_PATH} )
MESSAGE( STATUS "SRC_PATH:    " ${SRC_PATH} )
MESSAGE( STATUS "EXE_PATH:    " ${EXE_PATH} )

PROJECT( ${PRJ_NAME} )

INCLUDE_DIRECTORIES(
	${LIB_PATH}
	${INC_PATH}/A
	${INC_PATH}/B
	${INC_PATH}/C )

FILE( GLOB
	PRJ_SOURCES
	${SRC_PATH}/${PRJ_NAME}.cpp )

MESSAGE( STATUS "SOURCES:" )
MESSAGE( STATUS "SOURCE:     " ${PRJ_SOURCES} )

FILE( GLOB_RECURSE
	PRJ_HEADERS
  ${INC_PATH}/*.h )

MESSAGE( STATUS "HEADERS:" )
foreach( hf ${PRJ_HEADERS} )
MESSAGE( STATUS "HEADER:     " ${hf} )
endforeach( hf )

FILE( GLOB 
	PRJ_LIBRARIES 
	${LIB_PATH}/* )

MESSAGE( STATUS "LIBRARIES:" )
foreach( lf ${PRJ_LIBRARIES} )
MESSAGE( STATUS "LIBRARY:    " ${lf} )
endforeach( lf )

ADD_EXECUTABLE( ${PRJ_NAME} ${PRJ_SOURCES} ${PRJ_HEADERS})
TARGET_LINK_LIBRARIES( ${PRJ_NAME} ${PRJ_LIBRARIES} )

ENABLE_TESTING()
INCLUDE( "CMakeTests.txt" )

